/**
* Copyright (c) By zengqh.
*
* This program is just for fun or demo, in the hope that it  
* will be useful, you can redistribute it and/or modify freely.
*
* Time: 2013/03/30
* File: ForDiffusePass.h
* Blog: http://www.cnblogs.com/zengqh/
**/

#pragma once

#include "../SceneRenderPass.h"

namespace HY
{
class ProgramGen;
class ForDiffusePass : public SceneRenderPass
{
public:
	enum
	{
		TransparentPass = 1 << 0,
		NoZwrite = 1 << 1,
		ZWriteOnly = 1 << 2,
		NoDiffuseMap = 1 << 3
	};

	enum
	{
		VS_TEXCOORD0 = 1 << 0
	};

	enum
	{
		FS_GAMMACORRECTION = 1 << 0,
		FS_DIFFUSEMAP = 1 << 1,
		FS_ALPHATEST = 1 << 2
	};

	struct GeneratedProgramUserData
	{
		ProgramAttribute*	v0;
		ProgramAttribute*	t0;
		ProgramUniform*		mvp;
		ProgramUniform*		diff_clr;
		ProgramUniform*		diff_map;
		ProgramUniform*		alpha_ref;
	};

public:
	virtual void render(const RenderableList& render_list);

protected:
	ForDiffusePass(RenderSystem* render_sys);
	virtual ~ForDiffusePass();

	void renderMesh(Mesh* mesh);

protected:
	ProgramGen*				pro_gen_;
	ProgramGen::Flags		pro_flags_;
};
}